package cmd

import (
	"os"

	"github.com/sirupsen/logrus"
)

const (
	ExitSuccess = iota
	ExitError
	ExitBadConnection
	ExitInvalidInput // for txn, watch cmd
	ExitBadFeature   // provided a valid flag with an unsupported value
	ExitInterrupted
	ExitIO
	ExitBadArgs = 128
)

func ExitWithError(code int, err error) {
	logrus.Error(err)
	os.Exit(code)
}
